<template>
  <div class="home">
     <p>年后开始搬砖的第{{count}}天</p>
     <button @click="add">搬砖计时器</button>
  </div>
</template>

<script>
// @ is an alias to /src
import { mapState, mapMutations } from 'vuex'
// mapState state 的辅助函数
export default {
  name: 'Home',
  components: {

  },
  computed:{
    ...mapState(['count'])
    // ...mapState({
    //   num: state => state.count
    // })
  },
  data(){
    return{
     
    }
  },
  methods: {
    // ...mapMutations(['storeAdd'])
    ...mapMutations({
      add: 'storeAdd'
    })
  },
}
</script>
